package com.medusa.aps.business.model.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import lombok.Getter;

@Getter
public enum AuxiliaryEnum {

    /**
     * 模具
     */
    MOULD(0, "模具"),

    /**
     * 工装
     */
    WORK_CLOTH(1, "工装"),

    /**
     * 夹具
     */
    TOOL(2, "夹具"),
    ;


    @EnumValue
    private final Integer value;
    private final String desc;

    AuxiliaryEnum(Integer value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public static AuxiliaryEnum getByDesc(String desc) {
        for (AuxiliaryEnum auxiliaryEnum : AuxiliaryEnum.values()) {
            if (auxiliaryEnum.getDesc().equals(desc)) {
                return auxiliaryEnum;
            }
        }
        return null;
    }

}
